<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测试DawnSql方法</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- Bootstrap -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
</head>
<body>
    <div class="container-fluid">
        <div class="row">
            <div class="panel panel-primary">
                  <div class="panel-heading">
                    <h3 class="panel-title">测试DawnSql方法</h3>
                  </div>
                  <div class="panel-body">
                    <div class="input-group" style="margin-bottom: 20px;">
                      <input type="text" id="user_token" style="width: 500px;" name="user_token" class="form-control" placeholder="用户组 user_token" aria-describedby="basic-addon2"/>
                    </div>
                    <div class="input-group" style="margin-bottom: 20px;">
                       <input type="text" id="func_name" style="width: 500px;" name="func_name" class="form-control" placeholder="函数名称" aria-describedby="basic-addon2"/>
                    </div>
                    <div class="input-group" style="margin-bottom: 20px;">
                      <input type="text" id="ps" name="ps" style="width: 500px;" class="form-control" placeholder="多个参数用英文的逗号隔开" aria-describedby="basic-addon2"/>
                      <span class="help-block">注意：如果输入的是字符串类型，必须加 '' 获取 ""， 如果输入的是序列则要加 []，如果输入的是字典则要加 {}</span>
                    </div>
                    <span class="input-group-btn">
                      <button class="btn btn-default" type="button" id="btn" style="margin-bottom: 28px;">提 交</button>
                    </span>
                  </div>
            </div>
            <div class="panel panel-primary">
                  <div class="panel-heading">
                    <h3 class="panel-title">结果</h3>
                  </div>
                  <div style="padding-left: 10px;" class="panel-body text-info">
                      <div id="show_url">
                      </div>
                      <div id="show_rs">
                      </div>
                  </div>
            </div>
        </div>
    </div>
<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
        <script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.9.1.min.js" type="text/javascript"></script>
        <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
        <script type="text/javascript">
        $(function () {
            $('#btn').click(function () {
                var user_token = $.trim($('#user_token').val());
                var func_name = $.trim($('#func_name').val());
                var ps = $.trim($('#ps').val());

                $.get('/serverless/', {'user_token': user_token, 'func': func_name, 'params': ps}, function (data) {
                    var url = '<c:url value="/serverless/?user_token=" />' + user_token + '&func=' + func_name + '&params=' + ps;
                    $('#show_url').text('');
                    $('#show_url').text('http 调用连接 ' + url);
                    $('#show_rs').text('');
                    $('#show_rs').text(data);
                });

            });
        });
    </script>
</body>
</html>






























